package com.tomshushu.doc.freedoc.modular.team.controller;

import com.tomshushu.doc.freedoc.core.model.response.ResponseData;
import com.tomshushu.doc.freedoc.core.model.response.SuccessResponseData;
import com.tomshushu.doc.freedoc.modular.team.model.param.AddTeamParam;
import com.tomshushu.doc.freedoc.modular.team.model.param.DeleteTeamParam;
import com.tomshushu.doc.freedoc.modular.team.model.param.EditTeamParam;
import com.tomshushu.doc.freedoc.modular.team.service.TeamService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/doc/team")
public class TeamController {

    @Resource
    private TeamService teamService;

    @PostMapping("/addTeam")
    public ResponseData addTeam(@RequestBody AddTeamParam addTeamParam) {
        teamService.addTeam(addTeamParam);
        return new SuccessResponseData();
    }

    @PostMapping("/deleteTeam")
    public ResponseData deleteTeam(@RequestBody DeleteTeamParam param) {
        teamService.deleteTeam(param);
        return new SuccessResponseData();
    }

    @PostMapping("/editTeam")
    public ResponseData editTeam(@RequestBody EditTeamParam param) {
        teamService.editTeam(param);
        return new SuccessResponseData();
    }

}